home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form RWAssoc
- BackColor = &H00C0C0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "Associate"
- ClientHeight = 1185
- ClientLeft = 1335
- ClientTop = 1905
- ClientWidth = 6675
- ControlBox = 0 'False
- Height = 1590
- Left = 1275
- LinkMode = 1 'Source
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1185
- ScaleWidth = 6675
- Top = 1560
- Width = 6795
- Begin TextBox AssProg
- Height = 300
- Left = 1605
- TabIndex = 2
- Top = 690
- Width = 4875
- End
- Begin CommandButton Ass
- Caption = "&Exit"
- Height = 345
- Index = 3
- Left = 5280
- TabIndex = 4
- Top = 195
- Width = 1200
- End
- Begin CommandButton Ass
- Caption = "Ass&ociate"
- Height = 345
- Index = 2
- Left = 3765
- TabIndex = 3
- Top = 195
- Width = 1200
- End
- Begin CommandButton Ass
- Caption = "&View"
- Height = 345
- Index = 1
- Left = 2205
- TabIndex = 1
- Top = 195
- Width = 1200
- End
- Begin TextBox Extension
- Height = 300
- Left = 1155
- TabIndex = 0
- Top = 225
- Width = 615
- End
- DefInt A-Z
- Sub Ass_Click (Index As Integer)
- NL$ = Chr$(13) + Chr$(10)
- Msg$ = "You must enter an extension first."
- Select Case Index
- Case 1
- Ext$ = LTrim$(RTrim$(Extension.Text))
- If Len(Ext$) Then
- Prog$ = LTrim$(RTrim$(GetWinStr("extensions", Ext$, "Not Associated")))
- If Prog$ <> "Not Associated" Then
- Pos = InStr(1, Prog$, Chr$(32))
- Prog$ = Left$(Prog$, Pos - 1)
- End If
- AssProg.Text = Prog$
- Else
- MsgBox Msg$, 48, "View Association"
- End If
- Case 2
- Tit$ = "Associate"
- Ext$ = LTrim$(RTrim$(Extension.Text))
- Prog$ = LTrim$(RTrim$(AssProg.Text))
- If Len(Ext$) Then
- If Len(Prog$) Then Prog$ = Prog$ + Chr$(32) + "^." + Ext$
- z = PutWinINI("extensions", Ext$, Prog$)
- If Not z Then
- MsgBox "Association failure.", 48, Tit$
- Else
- AssProg.Text = "Success: " + UCase$(Prog$)
- End If
- Else
- MsgBox Msg$, 48, Tit$
- End If
- Case 3
- Unload RWAssoc
- End Select
- End Sub
- Sub AssProg_KeyPress (KeyAscii As Integer)
- If KeyAscii = (32) Then
- KeyAscii = 0
- Beep
- Beep
- End If
- End Sub
- Sub Extension_KeyPress (KeyAscii As Integer)
- If KeyAscii = 46 Then
- KeyAscii = 0
- Beep
- Beep
- End If
- End Sub
- Sub Form_Load ()
- RWAssoc.Left = FBRunWay.Left
- RWAssoc.Top = FBRunWay.Top + FBRunWay.Height
- End Sub
- Sub Form_Paint ()
- FrameFrm RWAssoc
- FrameCtrl RWAssoc, Extension, Extension, Extension, Extension
- For x = 1 To 3
- FrameCtrl RWAssoc, Ass(x), Ass(x), Ass(x), Ass(x)
- Next x
- FrameCtrl RWAssoc, AssProg, AssProg, AssProg, AssProg
- LeftLabel "Extension:", RWAssoc, Extension
- LeftLabel "Associate With:", RWAssoc, AssProg
- End Sub
-